package com.kdtech.entity.crawler;

import java.io.Serializable;

public class UrlTask implements Serializable {
	private String analyseClass;
	private int addressValue=0;
	private int jobId ;
	private int entryID ;
	private String url;
	private String targetUrl; 	//来源网页
	private boolean isGetUrl=false;//是否需要提取url链接
	/**
	 *  提取到这个链接的 A标签上下文
	 */
	private String context;
	/**
	 * 1: 新闻 2：视频 3:论坛 4：问答/知道 5：平媒 6：博客
	 */
	private int type;//任务类型
	private boolean isRss=false;//是否rss类任务
	/**
	 * 是否入口地址
	 */
	private boolean isEntry=false;
	/**
	 * 是否用户关注的
	 */
	private boolean isUserAdd=false;
	public boolean isUserAdd() {
		return isUserAdd;
	}
	public void setUserAdd(boolean isUserAdd) {
		this.isUserAdd = isUserAdd;
	}
	public boolean isEntry() {
		return isEntry;
	}
	public void setEntry(boolean isEntry) {
		this.isEntry = isEntry;
	}
	public boolean isRss() {
		return isRss;
	}
	public void setRss(boolean isRss) {
		this.isRss = isRss;
	}
	public String getContext() {
		return this.context;
	}
	public void setContext(String context) {
		this.context = context;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	private boolean isUpdateRole=false;//是否更新任务


	public int getAddressValue() {
		return addressValue;
	}
	public void setAddressValue(int addressValue) {
		this.addressValue = addressValue;
	}
	public int getJobId() {
		return jobId;
	}
	public void setJobId(int jobId) {
		this.jobId = jobId;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public boolean isUpdateRole() {
		return isUpdateRole;
	}
	public void setUpdateRole(boolean isUpdateRole) {
		this.isUpdateRole = isUpdateRole;
	}

	public boolean isGetUrl() {
		return isGetUrl;
	}
	public void setGetUrl(boolean isGetUrl) {
		this.isGetUrl = isGetUrl;
	}
	public UrlTask(){}
	public UrlTask(String url,String src_url)
	{
		setUrl(url);
		this.targetUrl=src_url;
	}

	public String getAnalyseClass() {
		return analyseClass;
	}
	public void setAnalyseClass(String analyseClass) {
		this.analyseClass = analyseClass;
	}
	public String getTargetUrl() {
		return targetUrl;
	}
	public void setTargetUrl(String targetUrl) {
		this.targetUrl = targetUrl;
	}

	public void setEntryID(Integer entryID) {
		this.entryID = entryID;
	}

	public Integer getEntryID() {
		return entryID;
	}
	@Override
	public String toString() {
		return super.toString() + "UrlTask [url=" + url + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UrlTask other = (UrlTask) obj;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

}
